<template>
    <div>
        <video id="local-video" autoplay></video>

        <input type="text" v-model="inp" />
        <el-button @click="playBroadcast">开启直播</el-button>
    </div>
</template>

<script>
import { startVideoTalk, createRoom } from '../../utils/websocket'

export default {
    data() {
        return {
            inp: '',
        }
    },
    methods: {
        playBroadcast() {
            // 创建房间
            createRoom({
                roomId: new Date().getTime(),
                roomName: this.inp,
                userName: 'kkk',
            })
            // 开启直播
            startVideoTalk()
        },
    },
}
</script>

<style>
</style>